package org.allen.mst4j.service;

import org.allen.mst4j.common.Constants;
import org.allen.mst4j.sysBean.PagerBean;
import org.allen.mst4j.sysBean.ResultBean;
import org.sol.util.mybatis.MyBatisPojo;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

public interface BaseService {

	@Transactional(readOnly = true)
	public <T extends MyBatisPojo> PagerBean<T> select(T obj);

	@Transactional(readOnly = true)
	public <T extends MyBatisPojo> PagerBean<T> selectByPage(T obj);

	@Transactional(readOnly = false, propagation = Propagation.REQUIRED, timeout = Constants.DB_TIMEOUT)
	public <T extends MyBatisPojo> ResultBean<T> insert(T obj);

	@Transactional(readOnly = false, propagation = Propagation.REQUIRED, timeout = Constants.DB_TIMEOUT)
	public <T extends MyBatisPojo> ResultBean<T> update(T obj);

	@Transactional(readOnly = false, propagation = Propagation.REQUIRED, timeout = Constants.DB_TIMEOUT)
	public <T extends MyBatisPojo> ResultBean<T> delete(T obj);

}